import { useEffect, useState } from 'react'
import { getChannelsApi } from '@/apis/publicke'
export const useChannels = () => {
  const [channelsList, setChannelsList ] = useState([])
  useEffect(() => {
    const getChannels = async () => {
      const res = await getChannelsApi()
      setChannelsList(res.data.channels)
    }

    getChannels()
  }, [])

  return { channelsList }
}